<template>
    <div class="search_Data">
        <el-form  :model="form">  
        <el-form-item>          
                <div style="width:230px;margin-right:5px">
                    <el-input  v-model="form.name" placeholder="请输入院区" />
                </div>
                <el-button type="primary" @click="onSubmit">搜索</el-button>
            </el-form-item>
        </el-form>
        
    </div>
</template>

<script setup lang="ts">
import { emitChangeFn } from 'element-plus';
import { reactive,ref } from 'vue'
interface Iprops{
  loadData:(currentPage:number,pageSize:number,formdata: Record<string, string>)=> void
  pageSize:number
  currentPage:number
}
const props = defineProps<Iprops>()
// do not use same name with ref
export interface formType{
    "state"?: string
    "timer"?: string
    "region"?: string
    "name"?: string
}

const form = reactive({
    state: '',
    timer: '',
    region: '',
    name: '',
})

const onSubmit=()=>{
    if(form.name==='') return;
    // var formdata=new FormData();
    // for(let key in form){
    //     formdata.append(key,form[key]);
    // }
    // console.log(form,props.loadData)
    //???获取不到嘞 获取不到所以走get请求，走不到post请求
    props.loadData(props.currentPage,props.pageSize,form)

}
</script>

<style scoped>
.search_Data {
    width: 100%;
    float:none;
    padding-top: 10px;
}
.keshi{
    margin-left: 175px;
    margin-right: 5px;
}
.date{
    margin-left: 15px;
}
</style>